@extends('admin.layouts')
@section('css')
<!-- basic styles -->
<link href="{{asset('assets/css/bootstrap.min.css')}}" rel="stylesheet" />
<link rel="stylesheet" href="{{asset('assets/css/font-awesome.min.css')}}" />

<!--[if IE 7]>
<link rel="stylesheet" href="{{asset('assets/css/font-awesome-ie7.min.css')}}" />
<![endif]-->

<!-- fonts -->

<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />

<!-- ace styles -->

<link rel="stylesheet" href="{{asset('assets/css/ace.min.css')}}" />
<link rel="stylesheet" href="{{asset('assets/css/ace-rtl.min.css')}}" />
<link rel="stylesheet" href="{{asset('assets/css/ace-skins.min.css')}}" />

<!--[if lte IE 8]>
<link rel="stylesheet" href="{{asset('assets/css/ace-ie.min.css')}}" />
<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->

<script src="{{asset('assets/js/ace-extra.min.js')}}"></script>

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!--[if lt IE 9]>
<script src="{{asset('assets/js/html5shiv.js')}}"></script>
<script src="{{asset('assets/js/respond.min.js')}}"></script>
<![endif]-->
<script src='{{asset('assets/js/jquery-2.0.3.min.js')}}'></script>
@endsection
@section('content')
    <div class="main-content">
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
            </script>

            <ul class="breadcrumb">
                <li>
                    <i class="icon-home home-icon"></i>
                    <a href="#">首页</a>
                </li>
                <li class="active">控制台</li>
            </ul><!-- .breadcrumb -->

            <div class="nav-search" id="nav-search">
                <form class="form-search">
								<span class="input-icon">
									<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
									<i class="icon-search nav-search-icon"></i>
								</span>
                </form>
            </div><!-- #nav-search -->
        </div>

        <div class="page-content">
            <div class="page-header">
                <h1>
                    控制台
                    <small>
                        <i class="icon-double-angle-right"></i>
                        查看
                    </small>
                </h1>
            </div><!-- /.page-header -->

            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->

                    <div class="alert alert-block alert-success">
                        <button type="button" class="close" data-dismiss="alert">
                            <i class="icon-remove"></i>
                        </button>

                        <i class="icon-ok green"></i>

                        欢迎登录
                        <strong class="green">
                            后台管理系统
                        </strong>
                    </div>
                    @if(!empty(Session::get('admin')['role']))
                    @if(sizeof($notices)>0)

                        <div class="alert alert-block alert alert-info">
                            <button type="button" class="close" data-dismiss="alert">
                                <i class="icon-remove"></i>
                            </button>
                            <h5 style="text-align: center">公告：</h5>
                            <hr>
                            @foreach($notices as $noti)
                                {{$noti['notice']}}
                                <hr>
                            @endforeach
                        </div>
                        @endif
                    @endif
                    @if(empty(Session::get('admin')['role']))
                    <div class="row">
                        <div class="space-6"></div>

                        <div class="col-sm-12 infobox-container">
                            <div class="infobox infobox-green  ">
                                <div class="infobox-icon">
                                    <i class="icon-comments"></i>
                                </div>

                                <div class="infobox-data">
                                    <span class="infobox-data-number">{{$num['allcomments']}}</span>
                                    <div class="infobox-content">总评论</div>
                                </div>
                            </div>

                            <div class="infobox infobox-blue  ">
                                <div class="infobox-icon">
                                    <i class="icon-group"></i>
                                </div>

                                <div class="infobox-data">
                                    <span class="infobox-data-number">{{$num['alluser']}}</span>
                                    <div class="infobox-content">总用户</div>
                                </div>
                            </div>
                            <div class="infobox infobox-purple  ">
                                <div class="infobox-icon">
                                    <i class="icon-user"></i>
                                </div>

                                <div class="infobox-data">
                                    <span class="infobox-data-number">{{$num['allauthor']}}</span>
                                    <div class="infobox-content">总作者</div>
                                </div>
                            </div>

                            <div class="infobox infobox-pink  ">
                                <div class="infobox-icon">
                                    <i class="icon-list"></i>
                                </div>

                                <div class="infobox-data">
                                    <span class="infobox-data-number">{{$num['allarticle']}}</span>
                                    <div class="infobox-content">总文章</div>
                                </div>
                            </div>

                            <div class="infobox infobox-orange2 ">
                                <div class="infobox-icon">
                                    <i class="icon-picture"></i>
                                </div>

                                <div class="infobox-data">
                                    <span class="infobox-data-number">{{$num['allimages']}}</span>
                                    <div class="infobox-content">总图册</div>
                                </div>
                            </div>
                            <div class="space-6"></div>
                        </div>

                        <div class="vspace-sm"></div>

                    {{--    <div class="col-sm-5">
                            <div class="widget-box">
                                <div class="widget-header widget-header-flat widget-header-small">
                                    <h5>
                                        <i class="icon-signal"></i>
                                        访问来源
                                    </h5>

                                    <div class="widget-toolbar no-border">
                                        <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
                                            本周
                                            <i class="icon-angle-down icon-on-right bigger-110"></i>
                                        </button>

                                        <ul class="dropdown-menu pull-right dropdown-125 dropdown-lighter dropdown-caret">
                                            <li class="active">
                                                <a href="#" class="blue">
                                                    <i class="icon-caret-right bigger-110">&nbsp;</i>
                                                    本周
                                                </a>
                                            </li>

                                            <li>
                                                <a href="#">
                                                    <i class="icon-caret-right bigger-110 invisible">&nbsp;</i>
                                                    上周
                                                </a>
                                            </li>

                                            <li>
                                                <a href="#">
                                                    <i class="icon-caret-right bigger-110 invisible">&nbsp;</i>
                                                    本月
                                                </a>
                                            </li>

                                            <li>
                                                <a href="#">
                                                    <i class="icon-caret-right bigger-110 invisible">&nbsp;</i>
                                                    上月
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>

                                <div class="widget-body">
                                    <div class="widget-main">
                                        <div id="piechart-placeholder"></div>

                                        <div class="hr hr8 hr-double"></div>

                                        <div class="clearfix">
                                            <div class="grid3">
															<span class="grey">
																<i class="icon-facebook-sign icon-2x blue"></i>
																&nbsp; likes
															</span>
                                                <h4 class="bigger pull-right">1,255</h4>
                                            </div>

                                            <div class="grid3">
															<span class="grey">
																<i class="icon-twitter-sign icon-2x purple"></i>
																&nbsp; tweets
															</span>
                                                <h4 class="bigger pull-right">941</h4>
                                            </div>

                                            <div class="grid3">
															<span class="grey">
																<i class="icon-pinterest-sign icon-2x red"></i>
																&nbsp; pins
															</span>
                                                <h4 class="bigger pull-right">1,050</h4>
                                            </div>
                                        </div>
                                    </div><!-- /widget-main -->
                                </div><!-- /widget-body -->
                            </div><!-- /widget-box -->
                        </div><!-- /span -->--}}
                    </div><!-- /row -->
                        <div class="hr hr32 hr-dotted"></div>
                    @endif

                    <div class="row">
                        <div class="col-sm-6">
                            <div class="widget-box transparent">
                                <div class="widget-header widget-header-flat">
                                    <h4 class="lighter">
                                        <i class="icon-star orange"></i>
                                        网站信息
                                    </h4>

                                    <div class="widget-toolbar">
                                        <a href="#" data-action="collapse">
                                            <i class="icon-chevron-up"></i>
                                        </a>
                                    </div>
                                </div>

                                <div class="widget-body">
                                    <div class="widget-main no-padding">
                                        <table class="table table-bordered table-striped">
                                            <thead class="thin-border-bottom">
                                            <tr>
                                                <th>
                                                    <i class="icon-caret-right blue"></i>
                                                    名称
                                                </th>

                                                <th>
                                                    <i class="icon-caret-right blue"></i>
                                                    值
                                                </th>
                                            </tr>
                                            </thead>

                                            <tbody>
                                            <tr>
                                                <td>运行环境</td>
                                                <td>{{$_SERVER['SERVER_SOFTWARE']}}</td>
                                            </tr>

                                            <tr>
                                                <td>版本</td>
                                                <td>v-1.0</td>
                                            </tr>
                                            <tr>
                                                <td>上传附件限制</td>
                                                <td><?php echo get_cfg_var ("upload_max_filesize")?get_cfg_var ("upload_max_filesize"):"不允许上传附件"; ?></td>
                                            </tr>
                                            <tr>
                                                <td>北京时间</td>
                                                <td><?php echo date('Y年m月d日 H时i分s秒')?></td>
                                            </tr>
                                            <tr>
                                                <td>服务器域名/IP</td>
                                                <td>{{$_SERVER['SERVER_NAME']}} [ {{$_SERVER['SERVER_ADDR']}} ]</td>
                                            </tr>
                                            <tr>
                                                <td>Host</td>
                                                <td>{{$_SERVER['SERVER_ADDR']}}</td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div><!-- /widget-main -->
                                </div><!-- /widget-body -->
                            </div><!-- /widget-box -->
                        </div>
                        <div class="col-sm-6">
                            <div class="widget-box transparent" id="recent-box">
                                <div class="widget-header">
                                    <h4 class="lighter smaller">
                                        <i class="icon-rss orange"></i>
                                        最近
                                    </h4>

                                    <div class="widget-toolbar no-border">
                                        <ul class="nav nav-tabs" id="recent-tab">
                                            @if(empty(Session::get('admin')['role']))
                                            <li class="active">
                                                <a data-toggle="tab" href="#member-tab">用户</a>
                                            </li>
                                                <li>
                                                    <a data-toggle="tab" href="#comment-tab">评论</a>
                                                </li>
                                                @else
                                                <li class="active">
                                                    <a data-toggle="tab" href="#comment-tab">评论</a>
                                                </li>
                                            @endif
                                        </ul>
                                    </div>
                                </div>

                                <div class="widget-body">
                                    <div class="widget-main padding-4">
                                        <div class="tab-content padding-8 overflow-visible">
                                            @if(empty(Session::get('admin')['role']))
                                            <div id="member-tab" class="tab-pane active">
                                                <div class="clearfix">
                                                    @foreach($users as $user)
                                                        <div class="itemdiv memberdiv">
                                                            <div class="user">
                                                                <img alt="Joe Doe's avatar" src="
                                                            @if(!empty($user['avatar']))
                                                                {{$user['avatar']}}
                                                                @else
                                                                {{asset('assets/avatars/avatar2.png')}}
                                                                @endif
                                                                        " />
                                                            </div>

                                                            <div class="body">
                                                                <div class="name">
                                                                    <a href="#">{{$user['username']}}</a>
                                                                </div>

                                                                <div class="time">
                                                                    <i class="icon-time"></i>
                                                                    <span class="green">{{date('Y-m-d',$user['created_at'])}}</span>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    @endforeach
                                                </div>

                                                <div class="center">
                                                    <i class="icon-group icon-2x green"></i>
                                                    &nbsp;
                                                    <a href="{{url('admin/userlist')}}">
                                                        查看所有用户 &nbsp;
                                                        <i class="icon-arrow-right"></i>
                                                    </a>
                                                </div>

                                                <div class="hr hr-double hr8"></div>
                                            </div><!-- member-tab -->
@endif
                                            <div id="comment-tab" class="tab-pane
                                            @if(!empty(Session::get('admin')['role']))
                                                    active
                                                       @endif
                                            ">
                                                <div class="comments">
                                                    @foreach($comments as $c)
                                                        <div class="itemdiv commentdiv">
                                                            <div class="user">
                                                                <img alt="Bob Doe's Avatar" src="
                                                            @if(!empty($c['avatar']))
                                                                {{$c['avatar']}}
                                                                @else
                                                                {{asset('assets/avatars/avatar2.png')}}
                                                                @endif
                                                                        " />
                                                            </div>

                                                            <div class="body">
                                                                <div class="name">
                                                                    <a href="#">{{$c['username']}}</a>
                                                                </div>

                                                                <div class="time">
                                                                    <i class="icon-time"></i>
                                                                    <span class="green">{{date('Y-m-d H:i:s',$c['created_at'])}}</span>
                                                                </div>

                                                                <div class="text">
                                                                    <i class="icon-quote-left"></i>
                                                                    {{$c['comment']}}
                                                                </div>
                                                            </div>
                                                        </div>
                                                    @endforeach
                                                </div>

                                    {{--            <div class="hr hr8"></div>

                                                <div class="center">
                                                    <i class="icon-comments-alt icon-2x green"></i>

                                                    &nbsp;
                                                    <a href="#">
                                                        查看所有评论 &nbsp;
                                                        <i class="icon-arrow-right"></i>
                                                    </a>
                                                </div>

                                                <div class="hr hr-double hr8"></div>--}}
                                            </div>
                                        </div>
                                    </div><!-- /widget-main -->
                                </div><!-- /widget-body -->
                            </div><!-- /widget-box -->
                        </div><!-- /span -->

                        {{--<div class="col-sm-7">
                            <div class="widget-box transparent">
                                <div class="widget-header widget-header-flat">
                                    <h4 class="lighter">
                                        <i class="icon-signal"></i>
                                        销售统计
                                    </h4>

                                    <div class="widget-toolbar">
                                        <a href="#" data-action="collapse">
                                            <i class="icon-chevron-up"></i>
                                        </a>
                                    </div>
                                </div>

                                <div class="widget-body">
                                    <div class="widget-main padding-4">
                                        <div id="sales-charts"></div>
                                    </div><!-- /widget-main -->
                                </div><!-- /widget-body -->
                            </div><!-- /widget-box -->
                        </div>--}}
                    </div>

                    <div class="hr hr32 hr-dotted"></div>

                    <div class="row">


          {{--              <div class="col-sm-6">
                            <div class="widget-box ">
                                <div class="widget-header">
                                    <h4 class="lighter smaller">
                                        <i class="icon-comment blue"></i>
                                        会话
                                    </h4>
                                </div>

                                <div class="widget-body">
                                    <div class="widget-main no-padding">
                                        <div class="dialogs">
                                            <div class="itemdiv dialogdiv">
                                                <div class="user">
                                                    <img alt="Alexa's Avatar" src="{{asset('assets/avatars/avatar1.png')}}" />
                                                </div>

                                                <div class="body">
                                                    <div class="time">
                                                        <i class="icon-time"></i>
                                                        <span class="green">4秒钟前</span>
                                                    </div>

                                                    <div class="name">
                                                        <a href="#">Alexa</a>
                                                    </div>
                                                    <div class="text">大家好啊</div>

                                                    <div class="tools">
                                                        <a href="#" class="btn btn-minier btn-info">
                                                            <i class="icon-only icon-share-alt"></i>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="itemdiv dialogdiv">
                                                <div class="user">
                                                    <img alt="John's Avatar" src="{{asset('assets/avatars/avatar.png')}}" />
                                                </div>

                                                <div class="body">
                                                    <div class="time">
                                                        <i class="icon-time"></i>
                                                        <span class="blue">38秒以前</span>
                                                    </div>

                                                    <div class="name">
                                                        <a href="#">John</a>
                                                    </div>
                                                    <div class="text">框架很好用嘛</div>

                                                    <div class="tools">
                                                        <a href="#" class="btn btn-minier btn-info">
                                                            <i class="icon-only icon-share-alt"></i>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="itemdiv dialogdiv">
                                                <div class="user">
                                                    <img alt="Bob's Avatar" src="{{asset('assets/avatars/user.jpg')}}" />
                                                </div>

                                                <div class="body">
                                                    <div class="time">
                                                        <i class="icon-time"></i>
                                                        <span class="orange">2分钟以前</span>
                                                    </div>

                                                    <div class="name">
                                                        <a href="#">Bob</a>
                                                        <span class="label label-info arrowed arrowed-in-right">admin</span>
                                                    </div>
                                                    <div class="text">欢迎大家使用ACE后台管理系统.</div>

                                                    <div class="tools">
                                                        <a href="#" class="btn btn-minier btn-info">
                                                            <i class="icon-only icon-share-alt"></i>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="itemdiv dialogdiv">
                                                <div class="user">
                                                    <img alt="Jim's Avatar" src="{{asset('assets/avatars/avatar4.png')}}" />
                                                </div>

                                                <div class="body">
                                                    <div class="time">
                                                        <i class="icon-time"></i>
                                                        <span class="grey">3分钟以前</span>
                                                    </div>

                                                    <div class="name">
                                                        <a href="#">Jim</a>
                                                    </div>
                                                    <div class="text">大家多提提BUG</div>

                                                    <div class="tools">
                                                        <a href="#" class="btn btn-minier btn-info">
                                                            <i class="icon-only icon-share-alt"></i>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="itemdiv dialogdiv">
                                                <div class="user">
                                                    <img alt="Alexa's Avatar" src="{{asset('assets/avatars/avatar1.png')}}" />
                                                </div>

                                                <div class="body">
                                                    <div class="time">
                                                        <i class="icon-time"></i>
                                                        <span class="green">4分钟以前</span>
                                                    </div>

                                                    <div class="name">
                                                        <a href="#">Alexa</a>
                                                    </div>
                                                    <div class="text">继续支持ACE后台系统</div>

                                                    <div class="tools">
                                                        <a href="#" class="btn btn-minier btn-info">
                                                            <i class="icon-only icon-share-alt"></i>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <form>
                                            <div class="form-actions">
                                                <div class="input-group">
                                                    <input placeholder="Type your message here ..." type="text" class="form-control" name="message" />
																<span class="input-group-btn">
																	<button class="btn btn-sm btn-info no-radius" type="button">
                                                                        <i class="icon-share-alt"></i>
                                                                        发送
                                                                    </button>
																</span>
                                                </div>
                                            </div>
                                        </form>
                                    </div><!-- /widget-main -->
                                </div><!-- /widget-body -->
                            </div><!-- /widget-box -->
                        </div><!-- /span -->--}}
                    </div><!-- /row -->

                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->
@endsection
@section('javascript')
<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='{{asset('assets/js/jquery-1.10.2.min.js')}}'>"+"<"+"script>");
</script>
<![endif]-->

    <script type="text/javascript">
        if("ontouchend" in document) document.write("<script src='{{asset('assets/js/jquery.mobile.custom.min.js')}}'>"+"<"+"script>");
    </script>
    <script src="{{asset('assets/js/bootstrap.min.js')}}"></script>
    <script src="{{asset('assets/js/typeahead-bs2.min.js')}}"></script>

    <!-- page specific plugin scripts -->

    <!--[if lte IE 8]>
    <script src="{{asset('assets/js/excanvas.min.js')}}"></script>
    <![endif]-->

    <script src="{{asset('assets/js/jquery-ui-1.10.3.custom.min.js')}}"></script>
    <script src="{{asset('assets/js/jquery.ui.touch-punch.min.js')}}"></script>
    <script src="{{asset('assets/js/jquery.slimscroll.min.js')}}"></script>

    <script src="{{asset('assets/js/ace-elements.min.js')}}"></script>
    <script src="{{asset('assets/js/ace.min.js')}}"></script>
    <script type="text/javascript" src="{{asset('assets/layer/layer.js')}}"></script>
    <!-- inline scripts related to this page -->

@endsection
